<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
checkadmin(1)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>评论列表</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
<script type="text/javascript" language="javascript" src="admin_js/common.js"></script>
</head>
<body>
<br/>
<div style="width:300px;margin:0px auto;"><a href="?recdel=1">查看评论对象已经被删除的所有评论</a></div>
<form name="rzform" action="batch_delete.asp" method="post" id="rzform">
<input type="hidden" name="listtype" value="recordcomment"/>
<table cellspacing="0" cellpadding="0" class="table_800">
<tr>
<th class='tdcenter'>选择</th>
<th class='tdcenter'>序号</th>
<th class='tdcenter'>标题</th>
<th class='tdcenter'>评论对象</th>
<th class='tdcenter'>评论时间</th>
<th class='tdcenter'>回复时间</th>
<th class='tdcenter'>审核状态</th>
<th class='tdcenter'>操作</th>
</tr>
<%
dim page,sql,MyPage,rs,msgtype,recdel
page=GetIntQueryString("page")
recdel=Trim(request.querystring("recdel"))
If recdel="1" Then
sql="select id,title,author,recordid,addtime,fenlei,replytime,visible from c_record_comment where fenlei=1 and recordid not in(select id from c_article) order by id desc"
sql=sql&" union select id,title,author,recordid,addtime,fenlei,replytime,visible from c_record_comment where fenlei=2 and recordid not in(select id from c_product) order by id desc"
sql=sql&" union select id,title,author,recordid,addtime,fenlei,replytime,visible from c_record_comment where fenlei=3 and recordid not in(select id from c_photo) order by id desc"
sql=sql&" union select id,title,author,recordid,addtime,fenlei,replytime,visible from c_record_comment where fenlei=7 and recordid not in(select id from c_job) order by id desc"
else
sql="select id,title,author,recordid,addtime,fenlei,replytime,visible from c_record_comment  order by id desc"
End if
if page<=1 then
page = 1
end if
Set MyPage = New RZPage
MyPage.SetSQL = sql
MyPage.PageSize = 20
MyPage.SetCss_PreNext="nextprev"
MyPage.SetCss_NumPage="pagenum"
MyPage.SetCss_CurrentPage="currentpage"
Set rs = MyPage.GetRS()
dim i
For i=1 To MyPage.PageSize
If Not rs.EOF Then 
%> 
<tr class="row">
<td class='tdcenter'><input type="checkbox" name="id" id="id" value="<%=rs("id")%>"  onclick="chkRow(this);"/></td>
<td class='tdcenter'>
<%
if page<=1 then 
response.write(i)
else
response.write((page-1)*MyPage.PageSize+i)
end if 
%>
</td>
<td>&nbsp;
	<a href="recordcomment_show.asp?id=<%=rs("id")%>">
<%=rs("title")%></a>
</td>
<td>
<%
Dim fenlei,tablename,titlefield,proc
fenlei=rs("fenlei")
Select Case fenlei
	Case 1:
		tablename="c_article"
		titlefield="title"
		proc=RZ_PRE_ARTICLE_SHOW
	Case 2
		tablename="c_product"
		titlefield="productname"
		proc=RZ_PRE_PRODUCT_SHOW
	Case 3
		tablename="c_photo"
		titlefield="photoname"
		proc=RZ_PRE_PHOTO_SHOW
	Case 7
		tablename="c_job"
		titlefield="name"
		proc=RZ_PRE_JOB_SHOW
End Select
dim sql2,rs2
sql2="select * from "&tablename&" where id="&rs("recordid")
set rs2=server.createobject("adodb.recordset")
rs2.open sql2,conn,1,1
if not rs2.eof Then 
dim path,LinkURL
path=CutPath(rs2("path"))
LinkURL="../index.asp?"&proc&rs2("lang")&"-t"&path&"c"&rs2("id")&".html"
If rs2("specialid")>0 Then
	LinkURL="../index.asp?"&proc&rs2("lang")&"-t"&path&"s"&rs2("specialid")&"c"&rs2("id")&".html"
End If 
%>
<a href="<%=LinkURL%>" target="_blank" title="<%=rs2(titlefield)%>"><%=Left(rs2(titlefield),12)%></a>
<%
Else
response.write("<span style='color:red;'>该评论对象已被删除</span>")
End If
rs2.close
set rs2=nothing
%>
	</td>
<td class='tdcenter'><%=rs("addtime")%></td>
<td class='tdcenter'><%If Year(rs("replytime"))=2000 Then response.write("未回复") Else response.write(rs("replytime"))%></td>
<td class='tdcenter'>
<a href="comment_changestate.asp?fr=recordcommentlist&id=<%=rs("id")%>">
<%If rs("visible")=1 Then response.write("显示") Else response.write("隐藏") End If %>
</a>
</td>
<td class='tdcenter'><a href="recordcomment_show.asp?id=<%=rs("id")%>#reply">回复</a>&nbsp;<a href="recordcomment_edit.asp?id=<%=rs("id")%>">修改</a>&nbsp;<a href="recordcomment_delete.asp?id=<%=rs("id")%>">删除</a>
&nbsp;
</td>
</tr>
<%
rs.Movenext
Else
Exit For
End If
Next
%>
<tr>
<td colspan="8" class="tdcenter">
<input name="selectall" type="checkbox" id="selectall" value="" onclick="selectAll();" />全选&nbsp;&nbsp;&nbsp;<input type="button" name="del"  class="btn" onclick="deleteselect();" value="批量删除"/>
</td>
</tr>
</table>
</form>
<div id="bottompage">
<%MyPage.ShowPage()%>
<span class="recordcount">
<%MyPage.ShowPageInfo()%>
</span>
</div>
</body>
</html>
